Path: blob/master/Part 4 - Clustering/Hierarchical Clustering/[R] Hierarchical Clustering.ipynb
1009 views
Kernel: R
Hierarchical Clustering
Data Preprocessing
In [1]:
In [3]:
Out[3]:
Using the dendrogram to find the optimal number of clusters
In [5]:
Out[5]:
From the above dendrogram we can see that the maximum length verticle line whcih does not have any horizontal line is the one providing the number of clusters as 5.
Fitting hierarchical clustering to the Mall datset
In [7]:
In [9]:
Out[9]:
Visualising the clusters
In [10]:
Out[10]:
The target customers should be the one with High Earning and High Spend. Here the datapoints inside cluster 1 are the customers with High Earning and High Spend